<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
<script>
    var tablewidth=400;
    var tableheight=400;
    var borderwidth=1;
    document.write("<table border=1 width=400 height=400>");
    function creatTable(rows,cols){
        var i,j;
        for(i=0;i<rows;i++)
        {
            document.write("<tr>");
            for(j=0;j<cols;j++){
                document.write("<td>");
                document.write("&nbsp;");
                document.write("</td>");
            }
        document.write("</tr>");
        }
        document.write("</table>");
    }
    creatTable(6,6);
    
</script>
</html>